<template>
    <div id="box">
        <div class="orderHead">
            <h4>订单</h4>
        </div>
        <noLogined @isLogin="isLogin" v-if="user==''" :name="'订单'"></noLogined>
        <orderInfo v-if="user!=''"></orderInfo>
    </div>
</template>

<script>
    import noLogined from '../subComs/noLogined.vue'
    import orderInfo from './orderInfo.vue'
    export default {
        name: "order",
        components:{
            noLogined,orderInfo
        },
        data(){
            return {
                user:''
            }
        },
        methods:{
            getUser(){
                this.user = this.$store.state.user
            },
            isLogin(){
                this.getUser()
            },
        },
        created() {
            this.getUser()
        }
    }
</script>

<style lang="less" scoped>
#box{
    display: flex;
    flex-direction: column;
    .orderHead{
        background-color: #FFCA0D;
        height: 80px;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

</style>